﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NETCORE.DI.Scoped.IService;
using NETCORE.DI.Scoped.Service;

namespace NETCORE.DI.Scoped.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class DIController : ControllerBase
    {
        private IOperation _ioperation;

        private OperationService _operationService;

        public DIController(IOperation operation, OperationService operationService)
        {
            _ioperation = operation;

            _operationService = operationService;
        }

        [HttpGet]
        [Route("Getgg")]
        public JsonResult Getgg()
        {
            var opt_g = _ioperation.OperationId;

            var opts_g = _operationService.getgg();

            return new JsonResult(new { controller = opt_g, service = opts_g });
        }
    }
}
